<template>
  <div class="hotel" v-if="hotelData">
    <!-- 面包屑 -->
    <div class="crumbs">
      <div>{{hotelData.breadcrumb}}</div>
    </div>
    <!-- /面包屑 -->

    <!-- 酒店名字、评分 -->
    <div class="hotelName">
      <div class="hotelName_name">
        <!-- 酒店名渲染 -->
        <span>{{hotelData.name}}</span>
        <i class="iconfont iconhuangguan" v-for="item in hotelData.hotellevel" :key="item.level"></i>
      </div>
      <!-- 酒店别名渲染 -->
      <div class="hotelEnglish">{{hotelData.alias}}</div>
      <div class="hotelLocation">
        <!-- 酒店位置渲染 -->
        <i class="iconfont iconlocation"></i>
        {{hotelData.address}}
      </div>
    </div>
    <!-- /酒店名字、评分 -->

    <!-- 酒店图片 -->
    <div class="hotelImages">
      <div class="largerMap">
        <!-- 大图数据 -->
        <img :src="hotelData.photos" alt />
      </div>
      <div class="smallPicture">
        <!-- 静态图 -->
        <img src="../../images/1.jpeg" />
        <img src="../../images/2.jpeg" />
        <img src="../../images/4.jpeg" />
        <img src="../../images/5.jpeg" />
        <img src="../../images/6.jpeg" />
        <img src="../../images/4.jpeg" />
      </div>
    </div>
    <!-- /酒店图片 -->
  </div>
</template>

<script>
export default {
  props: ["data"],
  data() {
    return {
      hotelData: {},
    };
  },
  watch: {
    data: {
      handler(val) {
        console.log('----酒店详情信息组件接收父组件传递过来的值:----');
        this.hotelData = val;
        console.log(this.hotelData);
      },
      deep: true,
    },
  },
  mouted() {},
};
</script>
<style lang="less" scoped>
.hotel {
  // 面包屑
  .crumbs {
    font-size: 14px;
    margin: 10px 0;
  }
  // 酒店名字，评分
  .hotelName {
    margin: 15px 0;
    .hotelName_name {
      span {
        font-size: 24px;
      }
      i {
        color: #ff9900;
      }
    }
    .hotelEnglish,
    .hotelLocation {
      font-size: 14px;
      color: #6d6f73;
    }
  }
  // 酒店图片
  .hotelImages {
    margin: 30px 0;
    display: flex;
    justify-content: space-between;
    .largerMap {
      width: 645px;
      height: 360px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .smallPicture {
      display: flex;
      flex-wrap: wrap;
      width: 345px;
      height: 370px;
      img {
        margin-left: 12px;
        width: 160px;
        height: 113px;
      }
    }
  }
}
</style>